unit UtilLib;

interface
uses
  AdvGrid;
  
procedure ClearAdvGrid(AAdvGrid:TAdvStringGrid;ARowCount:integer);

implementation

procedure ClearAdvGrid(AAdvGrid:TAdvStringGrid;ARowCount:integer);
begin
  with AAdvGrid do
  begin
    BeginUpdate;
    Filter.Clear;
    Filteractive:=False;
    ClearRows(1,RowCount - 1);
    RemoveRows(2,RowCount - 2);
    if ARowCount > 1 then
      RowCount:=ARowCount+1
    else
      RowCount:=2;
    EndUpdate;
  end;
end;

end.
